--- import Layout from '@layouts/Layout.astro'; import ServiceList from '@components/things/ServiceList.astro'; import Comments from '@components/things/Comments.svelte'; import GitHubDetailedInfo from '@components/things/GitHubDetailedInfo.astro'; import PrivacyPolicyDetails from '@components/things/PrivacyPolicyDetails.astro'; import WebsiteDetailedInfo from '@components/things/WebsiteDetailedInfo.astro'; import type { AwesomePrivacy, Section, Service } from '../types/Service'; import { fetchData, slugify } from '@utils/fetch-data'; import { fetchGitHubStats } from '@utils/fetch-repo-info'; import { fetchTosdrPrivacy } from '@utils/fetch-privacy-policy'; import { fetchWebsiteInfo } from '@utils/fetch-website-info'; import { parseMarkdown, formatLink } from '@utils/parse-markdown'; import FontAwesome from '@components/form/FontAwesome.svelte'; import Button from '@components/form/Button.astro'; interface Props extends Service { slug: string; parentSection: Section; categoryName: string; } const { name, description, url, github, tosdrId, icon, followWith, securityAudited, openSource, acceptsCrypto, parentSection, categoryName, } = Astro.props; /** * Make a list of keywords, for the tag */ const makeKeyWordTag = () => { const keywords: string[] = []; keywords.push(`free and open source ${parentSection.name} software`); keywords.push(`private ${parentSection.name} comparison`); (parentSection.alternativeTo || []).forEach((alt: string) => { keywords.push(`privacy-respecting ${alt} alternative`); keywords.push(`free open source ${alt} alternative`); }); (parentSection.services || []).forEach((serv: Service) => { keywords.push(serv.name); }); keywords.push('ad free'); keywords.push('open source software'); keywords.push('privacy respecting apps'); return keywords.join(', '); }; /** * Make a page title */ const makePageTitle = () => { return `${name} | ${parentSection.name} | ${categoryName} | Awesome Privacy`; }; /** * Make a string page intro, for the description tag */ const makeDescriptionTag = () => { return `Compare ${name} and other ${parentSection.name} at Awesome Privacy\n` + description + '\nAll this, and much more at Awesome Privacy, ' + 'the free and open source list of private software alternatives.'; }; // Return a list of Services, except for the currtent one const filterServices = () => { return parentSection.services.filter((service: Service) => service.name !== name); }; export async function getStaticPaths() { const pages = await fetchData().then((data) => { const results: Array = []; if (!data || !data.categories) return results; (data as AwesomePrivacy).categories.forEach((category) => { category.sections.forEach((section) => { const services = (section.services || []).map((service) => { return { slug: `${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`, parentSection: section, categoryName: category.name, ...service, }; }); results.push(...services); }); }); return results; }); return pages.map((props: Props) => { return {params: { listing: props.slug }, props }; }); } const makePaginationLinks = () => { const allServices = parentSection.services || []; const index = allServices.findIndex(item => item.name === name); const previousItem = index > 0 ? allServices[index - 1].name : null; const nextItem = index < allServices.length - 1 ? allServices[index + 1].name : null; return { previous: previousItem, next: nextItem }; }; const { previous, next } = makePaginationLinks(); const ignoredSites = ['github.gom', 'wikipedia.']; // Fetch detailed data about the services GitHub repo, privacy policy and website const githubData = github ? await fetchGitHubStats(github) : null; const privacyData = tosdrId ? await fetchTosdrPrivacy(tosdrId) : null; const websiteData = (url && !ignoredSites.some(ignoredSite => url.includes(ignoredSite))) ? await fetchWebsiteInfo(url) : null; ---

{name}

{formatLink(url)}
{`${name}

{ securityAudited && ( Security Audited )} { acceptsCrypto && ( Crypto Payments Accepted )} { securityAudited === false && ( No Security Audit )} { (openSource === false) && ( Not Open Source )} { openSource || (github && openSource !== false) ? ( Open Source ) : null }
{ privacyData && (

{name} Privacy Policy

)} { github && githubData && (

{name} Source Code

)} { websiteData && (

{name} Website

)}

{name} Reviews

More {parentSection.name}

{ previous ? ( ) :

} View {parentSection.name} ({(parentSection.services || []).length}) { next && ( )}